package com.project.service;

import com.alibaba.fastjson.JSONObject;
import com.project.entity.School;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @Author: TateBrown
 * @date: 2018/5/26 15:02
 * @param:
 * @return:
 */
public interface SchoolService {
    /**
     * author: WheelChen
     * date: 2017-5-4
     * function: 增加学院
     * @param school
     * @return
     */
    int add(School school);

    /**
     * author: WheelChen
     * date: 2017-5-4
     * function: 根据id删除学院
     * @param id
     * @return
     */
    int remove(Integer id);

    /**
     * author: WheelChen
     * date: 2017-5-4
     * function: 根据id修改学院信息
     * @param school
     * @return
     */
    int modify(School school);

    /**
     * author: WheelChen
     * date: 2017-5-4
     * function: 根据id寻找学院信息
     * @param id
     * @return
     */
    School findOne(Integer id);

    /**
     * author: WheelChen
     * date: 2017-5-4
     * function: 根据universityid寻找学院信息以及学院下的管理员
     * @param universityid
     * @return
     */
    List<JSONObject> findBatchWithAdminByUniversityId(Integer universityid) throws Exception;

    /**
     * author: WheelChen
     * date: 2017-5-4
     * function: 根据universityid寻找学院信息
     * @param universityid
     * @return
     */
    List<School> findBatchByUniversityId(Integer universityid);

    /**
     * author: WheelChen
     * date: 2017/7/11
     * function: 检查是否已存在同一所学校相同学院
     *
     * @param school
     * @return
     */
    boolean checkUniversityIdAndNameIsExist(School school);

    /**
     * author: WheelChen
     * date: 2017/10/30
     * function: 删除学院及学院下的所有学生信息以及学院管理员信息
     *
     * @param schoolId
     * @param request
     * @return
     */
    boolean removeOneChain(Integer schoolId, HttpServletRequest request);

}
